#ifndef layer_game_menu_h
#define layer_game_menu_h

#import "head.h"

#define GAME_MENU_STATE_PAUSE 0
#define GAME_MENU_STATE_WIN 1
#define GAME_MENU_STATE_LOSE 2
#define GAME_MENU_STATE_TIME_UP 3

typedef struct SItemDropProbabilityRange_
{
	int min;
	int max;
}
SItemDropProbabilityRange;

/*layer_game_menu
*/
@interface LayerGameMenu : CCLayer
{
	bool flagFunctionLock_;

	/*background
	*/
	CCSprite *backgroundWin_;
	CCSprite *backgroundLose_;

	/*title
	*/
	CCSprite *pause_;
	CCLabelBMFont *win_;
	CCLabelBMFont *lose_;
	CCLabelBMFont *timeUp_;

	/*star and text
	*/
	CCSprite *starHeart_;
	CCSprite *starEnemy_;
	CCSprite *starSpecial_;
	CCLabelBMFont *textHeart_;
	CCLabelBMFont *textEnemy_;
	CCLabelBMFont *textSpecial_;
	CCSprite *starHeartEffect_;
	CCSprite *starEnemyEffect_;
	CCSprite *starSpecialEffect_;

	/*loser
	*/
	CCSprite *loseHeart_;

	/*menu
	*/
	CCMenu *menuPause_;
	CCMenu *menuOver_;
	CCMenuItemImage *itemResume_;
	CCMenuItemImage *itemRestart_;
	CCMenuItemImage *itemQuit_;
	CCMenuItemImage *itemRetry_;
	CCMenuItemImage *itemNext_;
	CCMenuItemImage *itemBackMenu_;
}

- (id)initLayerGameMenu:(int)State;
- (void)dealloc;
- (void)draw;

- (CCLabelBMFont *)CreateTitleText:(NSString *)String;
- (CCLabelBMFont *)CreateContextText:(NSString *)String;
- (void)CreateMenuGetItem;
- (void)DeleteMenuGetItem;

- (void)MissionStart;

/*call back function
*/
- (void)CallBackMenuItemResume:(id)Sender;
- (void)CallBackMenuItemRestart:(id)Sender;
- (void)CallBackMenuItemQuit:(id)Sender;
- (void)CallBackMenuItemRetry:(id)Sender;
- (void)CallBackMenuItemNext:(id)Sender;
- (void)CallBackMenuItemBackMenu:(id)Sender;

@end

/*sprite_game_menu_get_item
*/
@interface sprite_game_menu_get_item : CCLayer
{
	bool flagTouchLock_;

	CCSprite *dummy_;

	SItemDropProbabilityRange range_[ITEM_TYPE_COUNT];
	std::vector<CCLabelTTF *> nameTable_;
	std::vector<CCSprite *> imageTable_;
	std::vector<CCLabelTTF *> textTable_;
	UICenterRect coverRect_;
}

- (id)initSpriteGameMenuGetItem;
- (void)draw;

- (void)TouchEnded:(CGPoint)Point;

- (void)ActionOpen;
- (void)ActionClose;

- (void)CallBackActionOpenOver:(id)Sender;
- (void)CallBackActionCloseOver:(id)Sender;

@end

#endif